package com.orchidea.uml.events
{
    import com.orchidea.uml.model.AbstractUmlModelElement;
    import com.orchidea.uml.model.document.Document;
    import flash.events.Event;
import flash.events.Event;


    /**
     * Event representing a structural change
     * Dispatched by model in response to model topology changes
     */
    public class ModelEvent extends Event
    {
        
        public static const ADD_CHILD : String              = "addChildModel";
        public static const REMOVE_CHILD : String           = "removeChildModel";

        public var kind : String;
        public var doc : Document;
        public var child : AbstractUmlModelElement;
        public var index : int;

        public function ModelEvent( type : String, kind : String, document : Document, child : AbstractUmlModelElement, index : int )
        {
            super(type);
            this.kind = kind;
            this.doc = document;
            this.child = child;
            this.index = index;
        }


        override public function clone():Event
        {
            return new ModelEvent(type, kind, doc, child, index);
        }
    }
}